<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
$(function(){
	//var sex = '${user.sex}';
	//$('#sex').combobox('select', sex);
	
	$("#saveButton").click(function(){
		var studentId = $("#studentId").val();
		var userName = $("#userName").val();
		var passWord = $("#passWord").val();
		var cnName = $("#cnName").val();
		var college = $("#college").val();
		var theClass = $("#theClass").val();
		var grade = $("#grade").val();
		var sex = $('#sex').combobox('getValue');
		var disable = $('#disable').combobox('getValue');
		var storiedBuilding = $("#storiedBuilding").val();
		if(userName!="" && passWord!="" && cnName!="" && college!="" && theClass!="" && grade!=""){
			$.ajax({
				type:'POST',
				url:"UserManagementEdit.action",
				data:{userName:userName,passWord:passWord,cnName:cnName,college:college,theClass:theClass,grade:grade,storiedBuilding:storiedBuilding,sex:sex,studentId:studentId,disable:disable},
				datatype:'json',	
				success:function(msg){
					if(msg.state == "200"){
						parent.closeDialog();
					}
					if(msg.state == "500"){
						$.messager.alert("提示","更新失败");
						//parent.closeDialog();
					}
				}
			});
		}else{
			$.messager.alert("提示","信息填写不完整");
		}
	});
});